import java.io.BufferedReader;
import java.io.IOException;
import java.math.BigInteger;
import java.util.ArrayList;


public class PSTree {
	public Node prog;
	public static Tokenizer Core_TK;
	public static boolean DS = true;
	public static boolean write = false;
	public static boolean assign = false;
	private int indent = 0;
	public static ArrayList<BigInteger> inputdata= new ArrayList<BigInteger>(); 
	public PSTree(BufferedReader source) throws IOException{
		initialize(source);
		//this.Core_TK.print();
		this.prog = new Prog();
		int token = PSTree.Core_TK.getToken();
		if(token != 33){
			
			System.out.println("missing EOF token PStree");
			System.exit(1);
		}
	}
	
	private void initialize(BufferedReader source) throws IOException{
		this.Core_TK = new Tokenizer(source);
		
	}
	public void print(){
		this.prog.print(indent);
		System.out.println();
	}
	public void execute(){
		this.prog.execute();
		//symbolTable.print();
	}
	public static void print_ind(int indent){
		while(indent > 0){
			System.out.print("\t");
			indent--;
		}
	}
	public static void setinputdata(BufferedReader data) throws IOException{
		// one input per line
		String line = data.readLine();
		while(line != null){
			BigInteger input = null;
			try{
				input = new BigInteger(line);
			}
			catch (Exception iOException){
				System.out.println("input data is not integer: "  + line);
				System.exit(1);
			}
		inputdata.add(input);
		line = data.readLine();
			
		}
	}
}
